<?= $this->Sgwy->addCss('/css/share/index.css'); ?>
<!--[if IE]>
    <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<![endif]-->
<?= $this->Sgwy->addJs('/plugin/ctimg/js/jqthumb.js'); ?>
<?= $this->Sgwy->addJs('/plugin/ctimg/js/main.js'); ?>
<?php echo $this->Html->script('/js/page.js');?>  
    <div class="share">      
           <div class="wav_title">
        <p>分享列表</p>
        <img class="lazy" onclick="window.location.href='/community/index/' " src="/images/common/grey.gif" data-original="/images/mobile/fanhui.png"><span>首页</span>
        </div> 
        <div class="content">
            <div class="banner_pc"><a href="http://pht.zoosnet.net/LR/Chatpre.aspx?id=PHT13532865&lng=cn" target="_blank" style="display:block;width:100%;height:100%;"></a></div>
            <div class="banner_ph">
                <img class="lazy" src="/images/common/grey.gif" data-original="/images/share/banner_fenxiang.jpg">
            </div>
            <div class="top">
                <p><a href="#">首页</a> >  分享</p>                
                <div class="tag">
                    <h2>社区分享<span>Share Topic</span></h2>
                    <a href="/personal/my_shares/" title=""></a>
                </div>                                  
            </div>

            <div class="main">
                <div class="screen">
                    <div class="category">
                        <a href="/share/index/<?=$cid?>.html" title="全部" class="<?php echo  empty($seletCss)? "add":"";?>">全部</a>  
                        <?php  foreach($share_tags as $key => $value):?> 
                        <a href="/share/index/<?php echo $cid."-".$key.".html";?>" title="<?=$value?>"  class="<?php echo !empty($seletCss) && $seletCss==$key ? "add":"";?>"><?=$value?></a>
                        <?php endforeach;?>  
                    </div>
                    <div class="hos">
                        <a href="/share/index/<?php echo "0-".intval($seletCss).".html";?>" title="全部" class="<?php echo  empty($cid)? "add":"";?>">全部</a>  
                        <?php  foreach($share_tags2 as $key => $value):?> 
                        <a href="/share/index/<?php echo $key."-".intval($seletCss).".html";?>" title="<?=$value?>"  class="<?php echo !empty($cid) && $cid==$key ? "add":"";?>"><?=$value?></a>
                        <?php endforeach;?>  
                    </div>
                </div>
                
                <div class="patient"> 
                    <div class="new_list_b" id="loadPage">
                        <ul>
                        <?php foreach ($dataList as $key => $value):?>
                        <li>
                            <div class="list_li">
                                <div class="touxiang"><img src="<?=$value['Share']['avatar']?>" alt="<?=$value['Share']['username']?>"></div>
                                <div class="list_b_right">
                                    <a href="/share/info/<?php echo $value["Share"]["id"].".html";?>">
                                    <div class="title_top"><?php  
                                    echo Ivf::trimall($value['Share']['description']);
                                    ?></div>
                                    </a>
                                    <div class="bottam">
                                        <div class="b_name"><?=$value['Share']['username']?></div>
                                        <div class="b_right">
                                            <div class="b_pic1"><?=$value['Share']['browse_num']?></div>
                                            <div class="b_pic2"><?=$value['Share']['comment_num']?></div>
                                            <div class="b_pic3 up  <?php echo $value['Share']['myagree']>0?'add_up':'';?>" <?php if($value['Share']['myagree']==0){?>onclick="adAgree(this,<?=$value["Share"]["id"]?>,'agree_share')"<?php }?>><?=$value['Share']['agree_num']?></div>
                                            <div class="b_right_mm">
                                                <div><img src="/images/hospital/y_1.png" />&nbsp;&nbsp;<?=$value['Share']['browse_num']?></div>
                                                <div><img src="/images/hospital/y_2.png" />&nbsp;&nbsp;<?=$value['Share']['comment_num']?></div>
                                                <div><img src="/images/hospital/y_3.png" />&nbsp;&nbsp;<?=$value['Share']['agree_num']?></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="img_b">
                                <?php foreach ($value['Share']['images'] as $k => $v):?> 
                                    <?php foreach ($v as $kk => $vv):?>
                                        <?php if($kk<9):?>
                                            <?php echo $vv.'class="demo"/>';?>
                                        <?php endif;?>
                                    <?php endforeach;?> 
                                <?php endforeach;?>
                            </div>
                        </li>    
                        <?php endforeach;?>  
                        </ul>
                    </div> 
                    <?php if(sizeof($dataList) >= 6){?>
                    <div class="more" onclick="_page.getShare(this,<?php echo intval($cid);?>,'<?php echo $seletCss;?>','<?php echo $seachTitle;?>')">
                        <a href="javascript:void(0)" title="">加载更多</a>
                    </div>  
                    <?php }?>
                </div>

            </div> 
            <div class="fixed">               
                <a href="/hospital/index/"><img src="/images/share/guanggao_01.jpg" alt="泰国试管婴儿攻略"></a>
                <a href="/service/vip/"><img src="/images/share/guanggao_02.jpg" alt="泰国试管婴儿攻略"></a>
                <div class="fixed_ranking">
                    <span>精彩分享排行</span>
                    <a class="btn_week"style="margin-left:32px;">周排行</a>
                    <a class="btn_total" >总排行</a>
                    <div class="rank_week">
                        <ul>
                            <?php if(!empty($weekList)){?>
                            <?php foreach ($weekList as $key => $value):?> 
                            <li><a href="/share/info/<?php echo $value["Share"]["id"].".html";?>" >
                                <img class="lazy" src="<?=$value["Share"]["avatar"]?>" data-original="<?=$value["Share"]["avatar"]?>">
                                <div>
                                    <p><?=$value["Share"]["title"]?></p>
                                    <em>回答数:<i><?=$value["Share"]["comment_num"]?></i> </em>
                                </div>
                            </a></li>
                            <?php endforeach;?> 
                             <?php }else{?>
                            <?php foreach ($topList as $key => $value):?> 
                            <li><a href="/share/info/<?php echo $value["Share"]["id"].".html";?>" >
                                <img class="lazy" src="<?=$value["Share"]["avatar"]?>" data-original="<?=$value["Share"]["avatar"]?>">
                                <div>
                                    <p><?=$value["Share"]["title"]?></p>
                                    <em>回答数:<i><?=$value["Share"]["comment_num"]?></i> </em>
                                </div>
                            </a></li>
                            <?php endforeach;?>  
                            <?php }?> 
                        </ul>
                    </div>
                    <div class="rank_total">
                        <ul>
                            <?php foreach ($topList as $key => $value):?> 
                            <li><a href="/share/info/<?php echo $value["Share"]["id"].".html";?>" >
                                <img class="lazy" src="<?=$value["Share"]["avatar"]?>" data-original="<?=$value["Share"]["avatar"]?>">
                                <div>
                                    <p><?=$value["Share"]["title"]?></p>
                                    <em>回答数:<i><?=$value["Share"]["comment_num"]?></i> </em>
                                </div>
                            </a></li>
                            <?php endforeach;?>  
                            
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
<script>
$(document).ready(function(e) {
    $('.btn_week').css('color','#ff9a14');
    $('.btn_week').click(function(event) {
        $(this).css('color','#ff9a14');
        $('.btn_total').css('color','#666666')
        $('.rank_total').css({'display':'none'});
        $('.rank_week').css({'display':'block'});
    });
    $('.btn_total').click(function(event) {
        $(this).css('color','#ff9a14');
        $('.btn_week').css('color','#666666')
        $('.rank_week').css({'display':'none'});
        $('.rank_total').css({'display':'block'});
    });
    <?php if(sizeof($dataList) == 0 && !empty($seachTitle)){?>
            layer.msg("您搜索的分享不存在",{icon:5,time:1000});  
    <?php }?>
});
</script> 